<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simGetPositionOnPath</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1><a href="../apiOverview.htm">Regular API</a> function</h1>
<h3 class=subsectionBar><a name="simGetPositionOnPath" id="simGetPositionOnPath"></a>simGetPositionOnPath / sim.getPositionOnPath </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Retrieves the absolute interpolated position of a point along a path object. See also <a href="simGetOrientationOnPath.htm">sim.getOrientationOnPath</a>, <a href="simGetDataOnPath.htm">sim.getDataOnPath</a>, <a href="simGetPathPosition.htm">sim.getPathPosition</a> and <a href="simGetClosestPositionOnPath.htm">sim.getClosestPositionOnPath</a>.<br></td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn>simInt simGetPositionOnPath(simInt pathHandle,simFloat relativeDistance,simFloat* position)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div><strong>pathHandle</strong>: handle of the path object</div>
<div><strong>relativeDistance</strong>: a value between 0 and 1, where 0 is the beginning of the path, and 1 the end of the path. Make sure you selected the appropriate <a href="../pathPositionCalculationMethod.htm">path length calculation method</a>. See also <a href="simGetPathLength.htm">simGetPathLength</a>.  In order to retrieve the position that lies exactly on a specific path control point, specify following for <em>relativeDistance</em>: -ctrlPtIndex-1, where ctrlPtIndex is the zero-based index of the control point.<br>
</div>
<div><strong>position</strong>: pointer to 3 values (x, y and z)</div>
<div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div>-1 if operation was not successful<br>
</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>table_3 position=sim.getPositionOnPath (number pathHandle,number relativeDistance)<br></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div><strong>pathHandle</strong>: handle of the path object</div>
<div><strong>relativeDistance</strong>: a value between 0 and 1, where 0 is the beginning of the path, and 1 the end of the path. Make sure you selected the appropriate <a href="../pathPositionCalculationMethod.htm">path length calculation method</a>. See also <a href="simGetPathLength.htm">sim.getPathLength</a>.  In order to retrieve the position that lies exactly on a specific path control point, specify following for <em>relativeDistance</em>: -ctrlPtIndex-1, where ctrlPtIndex is the zero-based index of the control point.</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div></div>
<div><strong>position</strong>: table of 3 values (x, y and z)</div>
<div></div></td> 
</tr> 
</table> 

<br>
<p><a href="../apiFunctions.htm">All regular API functions on one page</a></p>
<br>
<br>
</td>
</tr>
</table>
</div>
</body>
</html>
